using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace SMS.Common.Entities
{
    public class Order
    {
        private string orderId;
        [XmlElement("OrderId", Order = 1)]
        public string OrderId
        {
            get { return orderId; }
            set { orderId = value; }
        }

        private string orderName;
        [XmlElement("OrderName", Order = 2)]
        public string OrderName
        {
            get { return orderName; }
            set { orderName = value; }
        }

        private string storeId;
        [XmlElement("StoreId", Order = 4)]
        public string StoreId
        {
            get { return storeId; }
            set { storeId = value; }
        }

        private string storeName;
        [XmlIgnore]
        public string StoreName
        {
            get { return storeName; }
            set { StoreName = value; }
        }

        private string orderDate;
        [XmlElement("OrderDate", Order = 6)]
        public string OrderDate
        {
            get { return orderDate; }
            set { orderDate = value; }
        }

        private string arriveDate;
        [XmlElement("ArriveDate", Order = 5)]
        public string ArriveDate
        {
            get { return arriveDate; }
            set { arriveDate = value; }
        }
        private string orderType;
        [XmlIgnore]
        public string OrderType
        {
            get { return orderType; }
            set { OrderType = value; }
        }
        private bool isUrgency;
        [XmlElement("IsRushOrder", Order = 3)]
        public bool IsUrgency
        {
            get { return isUrgency; }
            set { isUrgency = value; }
        }
        private string desc;
        [XmlElement("Memo", Order = 7)]
        public string Description
        {
            get { return desc; }
            set { desc = value; }
        }
        private string editor;
        [XmlIgnore]
        public string Editor
        {
            get { return editor; }
            set { editor = value; }
        }
        private DateTime editDate;
        [XmlIgnore]
        public DateTime EditDate
        {
            get { return editDate; }
            set { editDate = value; }
        }
        private string sender;
        [XmlIgnore]
        public string Sender
        {
            get { return sender; }
            set { sender = value; }
        }
        private DateTime sendDate;
        [XmlIgnore]
        public DateTime SendDate
        {
            get { return sendDate; }
            set { SendDate = value; }
        }
        private string status;
        [XmlIgnore]
        public string Status
        {
            get { return status; }
            set { status = value; }
        }
        private List<OrderDetail> orderDetail;
        [XmlArray("Items", Order = 8),XmlArrayItem("Item")]
        public List<OrderDetail> OrderDetail
        {
            get { return orderDetail; }
            set { orderDetail = value; }
        }

        public Order() { }

        public Order(string orderId, string orderName, string storeId, string storeName, string orderDate, string arriveDate, string orderType, bool isUrgency, string desc, string editor, DateTime editDate, string sender, DateTime sendDate, string status, List<OrderDetail> orderDetail)
        {
            this.orderId = orderId;
            this.orderName = orderName;
            this.storeId = storeId;
            this.storeName = storeName;
            this.orderDate = orderDate;
            this.arriveDate = arriveDate;
            this.orderType = orderType;
            this.isUrgency = isUrgency;
            this.desc = desc;
            this.editor = editor;
            this.editDate = editDate;
            this.sender = sender;
            this.sendDate = sendDate;
            this.status = status;
            this.orderDetail = orderDetail;

        }
        public Order(string orderId, string orderName, string storeId, string storeName, string orderDate, string arriveDate, string orderType, bool isUrgency, string status)
        {
            this.orderId = orderId;
            this.orderName = orderName;
            this.storeId = storeId;
            this.storeName = storeName;
            this.orderDate = orderDate;
            this.arriveDate = arriveDate;
            this.orderType = orderType;
            this.isUrgency = isUrgency;
            this.status = status;
        }
    }
    public class Orders
    {
        [XmlElement("Order")]
        public Order[] order;
    }

}
